home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / aminet / util / pack / xfh132.lzh / XFH / src / CFS.h < prev    next >
C/C++ Source or Header  |  1993-01-07  |  20KB  |  430 lines

  1. /* CFS.h - common definitions for XFH.
  2.    Copyright (C) 1991, 1992, 1993 Kristian Nielsen.
  3.  
  4.    This file is part of XFH, the compressing file system handler.
  5.  
  6.    This program is free software; you can redistribute it and/or modify
  7.    it under the terms of the GNU General Public License as published by
  8.    the Free Software Foundation; either version 2 of the License, or
  9.    (at your option) any later version.
  10.  
  11.    This program is distributed in the hope that it will be useful,
  12.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.    GNU General Public License for more details.
  15.  
  16.    You should have received a copy of the GNU General Public License
  17.    along with this program; if not, write to the Free Software
  18.    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.            */
  19.  
  20.  
  21. /* #include "patchup.h" */      /* Compiling in 1.3. */
  22. #include "version.h"
  23.  
  24. #include <exec/types.h>
  25. #include <libraries/dos.h>
  26. #include <libraries/dosextens.h>
  27. #include <dos/exall.h>
  28. #include <dos/notify.h>
  29.  
  30. #define IONAME    "ram:CFSIO"
  31.  
  32. #define MAXFILENAME 30        /* Maximum length of file names. */
  33. #define XROOTNAME "XFH"       /* Unit number and ':' will be appended. */
  34. #define XROOTNAMESIZE 15      /* Max. size of root assign (unit 2^32-1) */
  35.  
  36. #define ALTOPTIONPATH ".xfhrc"
  37.  
  38. #define TMPNAMETEMPLATE "%lx.%lx_XFH"   /* Used in sprintf(..,task,num) */
  39. #define TMPNAMEMAXSIZE  (8+ 1+8+4+  1)
  40.  
  41. #define AREXXPORTTEMPLATE "%s"         /* %s will be device name (XHx:) */
  42. #define AREXXPORTMAXLEN 1              /* Plus device name size. */
  43. #define AREXXPORTPRI 1
  44.  
  45. #define OUTOFMEM glob -> ioerr = ERROR_NO_FREE_STORE
  46. #define DECLIOERR LONG saveioerr;
  47. #define PUTIOERR saveioerr = glob->ioerr
  48. #define SAVEIOERR LONG saveioerr = glob->ioerr
  49. #define RESTIOERR glob->ioerr = saveioerr
  50.  
  51. #define MAXSTRING 256   /* Maximum length of some strings (like a path). */
  52. #ifdef DEBUG
  53. #define debug(a) dprintf a
  54. #include <DebugPrc.h>
  55. #else
  56. #define debug(a)
  57. #endif
  58.  
  59.  
  60. /* This is the structure used internally to represent a file/directory
  61.  * lock. All locks we return contain the address of this structure in their
  62.  * lock->fl_Key field.
  63.  *
  64.  * The CFSLock.refcount field is a sad hack nessesary to overcome a
  65.  * problem with exclusive directory locks when compressing files. The
  66.  * problem is that we need a copy of the parent lock used in RawCFSOpen()
  67.  * when the file is Close()'d. However, if the parent lock is exclusive,
  68.  * it cannot be DupLock()'ed, and so we must store a reference to it.
  69.  * The refcount counts the number of such references, and prevents the
  70.  * lock from going away until after the Close().
  71.  */
  72. struct CFSLock {
  73.   LONG objtype;
  74.   struct cfsfunctions *f;
  75.   LONG mode;
  76.   struct FileLock *xlock;
  77.   LONG refcount;            /* Currently valid only for XOBJECT's. */
  78. };
  79.  
  80.  
  81. /* Structure for file handles. */
  82. struct CFSFH {
  83.   LONG objtype;
  84.   struct cfsfunctions *f;
  85.   LONG mode;
  86.   struct FileHandle *xfh;
  87.   char *filename;            /* Used when compressing file at Close(). */
  88.   struct CFSLock *parent;   /* Used when compressing file at Close(). */
  89.   /* A non-null 'filename' field means (for xobj's) that Close() will
  90.    * attempt to compress the file. */
  91. };
  92.  
  93. /* CFSLock filetypes. */
  94. #define XOBJECTB  1      /* A simple handle on an object in ufs. */
  95. /* #define NUKEOBJECTB 2 */   /* The NUKE format (U. Mueller). */
  96. /* #define PPACKOBJB 3   */   /* Files packed with powerpacker. */
  97. #define XPKOBJECTB 4     /* Xpk.library files. */
  98.  
  99. #define XOBJECT     (1 << XOBJECTB)
  100. /* #define NUKEOBJECT  (1 << NUKEOBJECTB) */
  101. /* #define PPACKOBJ    (1 << PPACKOBJB)   */
  102. #define XPKOBJECT   (1 << XPKOBJECTB)
  103.  
  104.  
  105. /* Blocksize to fake in Examine()/ExNext(). */
  106. #define BLOCKSIZE glob->bytesperblock    
  107.  
  108. /* Global datastructure. This allow us to use global variables and still
  109.  * be reentrant without using any kind of short addressing (no need for
  110.  * any __saveds keywords or startup code).
  111.  */
  112. struct glob{
  113.   /* Shared data buffers to save on dalloc()'s.*/
  114.   /* Note that care should be taken when using these, since they are*/
  115.   /* shared between a number of functions. A rule of thumb is that a*/
  116.   /* lower level (dosfunc.c) shouldn't use something owned by a*/
  117.   /* higher level (lock.c). This way, a call in lock.c to a function*/
  118.   /* in dosfunc.c won't change your buffer, while a call to another*/
  119.   /* lock.c-function potentially may.*/
  120.     
  121.    char stringbuf[MAXSTRING];        /* Buffer for dosfunctions (bstr conv.) */
  122.    char stringbuf2[MAXSTRING];       /* Buffer for dosfunctions (bstr conv.) */
  123.    char pktstringbuf[MAXSTRING];     /* Buffer for packet bstr->cstr. */
  124.    char pktstringbuf2[MAXSTRING];    /* Buffer for packet bstr->cstr. */
  125.    struct FileInfoBlock fib1;        /* Used during Lock(). */
  126.    struct FileInfoBlock fib2;        /* General high-level in dosfunc.c */
  127.    struct StandardPacket iopkt;      /* This will be long alligned. */
  128.    struct InfoData infodata;
  129.    
  130.    struct MsgPort *dosport,          /* Dos Port (ProcId) of this handler. */
  131.                   *ioport,           /* Port to use for DOS IO. */
  132.                   *xpkport;          /* Port for calling Xpk in KS1.3. */
  133.    struct Task *mytask;              /* Copy of FindTask(0L) */
  134.    struct Process *myproc;
  135.    void *DOSBase;
  136.    struct Library *XpkBase;
  137.    struct Library *IconBase;
  138.    struct PPBase *PPBase;
  139.    struct DeviceNode *devnode;
  140.    char *devname;
  141.    struct DeviceList *volnode;       /* Pointer to our volumenode. */
  142.    BSTR bcplstartup;                 /* Copy of BPTR to startup string. */
  143.    struct CFSLock *rootlock;         /* Our rootlock. */
  144.    struct FileLock *xrootlock;       /* Rootlock for underlying fs. */
  145.    struct MsgPort *xprocid;          /* ProcID of the underlying fs. */
  146.    LONG ioerr;
  147.    short opencnt;
  148.    BOOL done;                        /* Flag for main packet loop. */
  149.    LONG tmpfilecount;                /* used for tmpfile generation. */
  150.    LONG bytesperblock;               /* Blocksize in the UFS. */
  151.    struct MsgPort *arexxport;
  152.    char *arexxportname;
  153.  
  154.    /* These are options handled by 'options.c'. */
  155.    /* Also read by SetConfigSem() in gui.c. */
  156.    char *badoption;                  /* Name of errorneous option. */
  157.    BOOL optionsset;                  /* True when options has been set. */
  158.    
  159.    BOOL stepdown;                    /* Flag for XpkPack(). */
  160.    BOOL autocompress;                /* Whether to compress on Write(). */
  161.    BOOL truncateonpack;              /* Use SetFileSize() when packing? */
  162.    char *packmode;                   /* Packmode for XpkPack(). */
  163.    char *xRootName;                  /* 'True' name of our root dir. */
  164.    char *uservolname;                /* User requested volume name. ONLY
  165.                                       * accessed by createvolnode(). */
  166.    char *xpkpassword;                /* Password used in Xpk(Un)Pack(). */
  167.    BOOL xpksetpri;                   /* Change taskpri when (un)packing? */
  168.    LONG xpkpri;                      /* priority to use if xpksetpri. */
  169.    BOOL createvolnode;               /* Whether se have a volume. *NOTE*: */
  170.                                      /* DON'T CHANGE AFTER createvolnode().*/
  171.    BOOL FailOnExNext;                /* Silently gobble ModifyFIB() errors.*/
  172.    BOOL compressreadwrite;           /* Whether to compress MODE_READWRITE.*/
  173.    BOOL allowappend;                 /* Whether to support MODE_READWRITE.*/
  174.    char *userarexxportname;         /* User requested name of AREXX port. */
  175.  
  176. #ifdef DEBUG
  177.    /* Extra fields for debug code. */
  178.    char debugbuf1[MAXSTRING];
  179.    char debugbuf2[MAXSTRING];        /* Used to print bcpl strings. */
  180. #endif DEBUG
  181.  
  182. };
  183. typedef struct glob *glb;
  184.  
  185.  
  186. /* For each of the supported file formats, there is an instance of this
  187.  * structure. It holds pointers to fuctions that performs tasks such as
  188.  * Read(), Lock(), etc.
  189.  */
  190. struct cfsfunctions {
  191. /*********************** Input/Output functions. ************************/
  192.       /* Open file from parent lock of this type and a simple filename
  193.        * (no path specification). This will determine file type and
  194.        * fetch the correct function to actually do the open.
  195.        */
  196.    struct CFSFH * (*Open)(glb, struct CFSLock *, char *, LONG);
  197.       /* Read(), Write(), Seek(), Close() functions. */
  198.    LONG (*Read)(glb, struct CFSFH *, UBYTE *, LONG );
  199.    LONG (*Write)(glb, struct CFSFH *, UBYTE *, LONG );
  200.    LONG (*Seek)(glb, struct CFSFH *, LONG, LONG );
  201.    LONG (*Close)(glb, struct CFSFH *);
  202.    BOOL (*SetFileSize)(glb, struct CFSFH *, LONG, LONG);
  203.    BOOL (*LockRecord)(glb, struct CFSFH *, LONG, LONG, LONG, LONG);
  204.    BOOL (*UnLockRecord)(glb, struct CFSFH *, LONG, LONG);
  205. /*********************** Input/Output functions. ************************/
  206.       /* Lock function. As with Open, the type refers to the parent lock. */
  207.    struct CFSLock * (*Lock)(glb, struct CFSLock *, char *, LONG);
  208.       /* Other functions related to locks. */
  209.    struct CFSLock * (*DupLock)(glb, struct CFSLock *);
  210.    BOOL (*UnLock)(glb, struct CFSLock *);   /* Always succesful. */
  211.    BOOL (*Examine)(glb, struct CFSLock *, struct FileInfoBlock *);
  212.    BOOL (*ExNext)(glb, struct CFSLock *, struct FileInfoBlock *);
  213.    struct CFSLock * (*CreateDir)(glb, struct CFSLock *, char *);
  214.    BOOL (*DeleteFile)(glb, struct CFSLock *, char *);
  215.       /* Rename() is a bit tricky. As an example, how is a Rename()
  216.        * from a powerpacked file to an archive to be handled?
  217.          * The correct Rename() function to call is determined from
  218.          * the type of the FROM directory. Each function must then
  219.          * check the type of the destination directory themselves.
  220.        */
  221.    BOOL (*Rename)(glb, struct CFSLock *, char *, struct CFSLock *, char *);
  222.    struct CFSLock * (*Parent)(glb, struct CFSLock *);
  223.    BOOL (*SetProtection)(glb, struct CFSLock *, char *, LONG);
  224.    BOOL (*SetComment)(glb, struct CFSLock *, char *, char *);
  225.    BOOL (*SetFileDate)(glb, struct CFSLock *, char *, struct DateStamp *);
  226.    struct CFSFH *(*OpenFromLock)(glb, struct CFSLock *);
  227.       /* ToDo: What is SameLock() really supposed to do, packet level?
  228.        * In the CFS, internally, each filetype has a SameLock() that
  229.        * expects two locks of the same type, and returns a bool.
  230.        */
  231.    BOOL (*SameLock)(glb, struct CFSLock *, struct CFSLock *);
  232.       /* ToDo: Support for links also really needs some work... */
  233.    BOOL (*MakeLink)(glb, struct CFSLock *, char *, void *, LONG);
  234.    LONG (*ReadLink)();
  235.    BOOL (*ChangeMode)(glb, LONG, void *, LONG);
  236.    struct CFSLock * (*DupLockFromFH)(glb, struct CFSFH *);
  237.    struct CFSLock * (*ParentOfFH)(glb, struct CFSFH *);
  238.       /* The new 2.0 Examine..() type functions. ExAll() will be
  239.        * simulated if NULL.
  240.        */
  241.    LONG (*ExAll)(glb, struct CFSLock *, char *, LONG, LONG, struct ExAllControl *);
  242.    BOOL (*ExamineFH)(glb, struct CFSFH *, struct FileInfoBlock *);
  243.       /* ToDo: The notify functions still need some thought. Remember,
  244.        * a notify is on an absolute path, not relative to a Lock.
  245.        */
  246.    BOOL (*StartNotify)(glb, struct NotifyRequest *);
  247.    BOOL (*EndNotify)(glb, struct NotifyRequest *);
  248. };
  249.  
  250. extern struct cfsfunctions PPfunc,Xfunc,Xpkfunc;
  251.  
  252.  
  253. /* Prototypes. */
  254. /* CFS.c */
  255. struct DosPacket *getpkt(glb glob);
  256. ULONG getpktsigmask(glb glob);
  257. struct DosPacket *checkpkt(glb glob);
  258. void returnpkt(struct DosPacket *pkt,LONG res1,LONG res2,glb glob);
  259. extern int sprintf(char *,const char *,...);
  260. struct MsgPort *DoDeviceProc(LONG *res2,char *filedesc,glb glob);
  261. BPTR getfile(char * desc,glb glob);
  262. void closefile(BPTR file,glb glob);
  263. void addvolnode(glb glob, struct DeviceList *volnode);
  264. BOOL removevolnode(glb glob, struct DeviceList *volnode);
  265. void DevNode_Stuff_Startup_String(glb glob, BSTR value);
  266. BOOL createvolnode(glb glob, BOOL fixroot, struct FileInfoBlock *fib);
  267. BOOL SetVolumeNameVolNode(glb glob, char *name);
  268. BOOL freevolnode(glb glob);
  269. BOOL diskinfo(glb glob, struct InfoData *infodata);
  270.  
  271. /* Packet.c */
  272. void putpkt(struct StandardPacket *pkt,struct MsgPort *procid,struct MsgPort *retport,LONG type,int numarg,...);
  273. LONG dopkt(struct StandardPacket *pkt,struct MsgPort *procid,struct MsgPort *retport,LONG *res2,LONG type,int numarg,...);
  274.  
  275.  
  276. /* dosfunc.c */
  277. struct FileLock *xLock(glb glob, struct FileLock *parent, char *name, LONG mode);
  278. BOOL xExists1(glb glob, struct FileLock *parent, char *name);
  279. BOOL xExamine(glb glob, struct FileLock *lock, struct FileInfoBlock *fib);
  280. BOOL xExamineNext(glb glob, struct FileLock *lock, struct FileInfoBlock *fib);
  281. struct FileLock *xCreateDir(glb glob, struct FileLock *parent, char *name);
  282. BOOL xDeleteFile(glb glob, struct FileLock *parent, char *name);
  283. BOOL xRename(glb glob, struct FileLock *parent1, char *name1, struct FileLock *parent2, char *name2);
  284. struct FileLock *xParentDir(glb glob, struct FileLock *lock);
  285. BOOL xSetProtection(glb glob, struct FileLock *parent, char *name, LONG bits);
  286. BOOL xSetComment(glb glob, struct FileLock *parent, char *name, char *comment);
  287. BOOL xSetFileDate(glb glob, struct FileLock *parent, char *name, struct DateStamp *ds);
  288. struct FileLock *xDupLock(glb glob, struct FileLock *lock);
  289. BOOL xUnLock(glb glob, struct FileLock *lock);
  290. struct FileHandle *xOpen(glb glob, struct FileLock *parent, char *name, LONG mode);
  291. struct FileHandle *xOpenFromLock( glb glob, struct FileLock *lock );
  292. struct FileHandle *xOpenFromCopyOfLock( glb glob, struct FileLock *lock );
  293. BOOL xClose(glb glob, struct FileHandle *fh);
  294. LONG xRead(glb glob, struct FileHandle *fh, void *buf, LONG len);
  295. LONG xWrite(glb glob, struct FileHandle *fh, void *buf, LONG len);
  296. LONG xSeek(glb glob, struct FileHandle *fh, LONG pos, LONG offset);
  297. BOOL xChangeMode(glb glob, ULONG type, void *obj, ULONG mode);
  298. BOOL xInfo(glb glob, struct FileLock *lock, struct InfoData *info);
  299. LONG xSameLock( glb glob, struct FileLock *l1, struct FileLock *l2 );
  300. BOOL xgetpath(glb glob, struct FileLock *Lock, char *f, int max);
  301. BOOL TransformXFH(glb glob, struct FileHandle *srcfh, struct FileLock *parent, char *name, BOOL (*f)(glb, struct FileHandle *, struct FileHandle *, void *), void *userdata);
  302. BOOL TransformFile(glb glob, struct FileLock *parent, char *name, BOOL (*f)(glb, struct FileHandle *, struct FileHandle *, void *), void *userdata);
  303. LONG xGetFileSize(glb glob, struct FileHandle *fh);
  304. BOOL xWriteStr(glb glob, struct FileHandle *fh, char *str);
  305.  
  306.  
  307. /* misc.c */
  308. char *copybstr(BSTR bstr);
  309. char *copystr(char *str);
  310. void freestr(char *str);
  311. char *safebstr2cinplace(UBYTE *pp, int buflen);
  312. BSTR safecstr2binplace(char *pp, int buflen);
  313. LONG ank( glb glob, ... );
  314. LONG ank_fail( glb glob, ... );
  315. LONG owt( glb glob, ... );
  316. LONG abs_seek_pos( LONG currentpos, LONG filelen, LONG pos, LONG offset );
  317. LONG xFileSizeXfh( glb glob, struct FileHandle *xfh );
  318.  
  319.  
  320. /* lock.c */
  321. struct CFSLock *RawCFSLock(glb glob, struct CFSLock *lock, char * name, LONG mode );
  322. struct FileLock * CreateFileLock( glb glob, struct CFSLock *lock );
  323. struct CFSLock *CFSLockParent( glb glob, struct CFSLock *parentlock, char **nameptr );
  324. struct CFSLock * CFSLock(glb glob,struct CFSLock * parentlock, char * name,LONG mode);
  325. struct CFSLock *makerootlockdayone(glb glob);
  326. struct CFSLock *CFSDupLock( glb glob, struct CFSLock *lock );
  327. struct CFSLock *CFSParentDir( glb glob, struct CFSLock *lock);
  328. BOOL CFSUnLock( glb glob,struct CFSLock *lock);
  329. BOOL CFSExamine( glb glob, struct CFSLock *lock, struct FileInfoBlock *fib);
  330. BOOL CFSExamineNext(glb glob, struct CFSLock *lock, struct FileInfoBlock *fib);
  331. struct CFSLock *CFSCreateDir( glb glob, struct CFSLock *parent, char *name );
  332. BOOL CFSDeleteFile( glb glob, struct CFSLock *parent, char *name );
  333. BOOL CFSRename( glb glob, struct CFSLock *parent1, char *name1, struct CFSLock *parent2, char *name2 );
  334. BOOL CFSSetProtection( glb glob, struct CFSLock *parent, char *name, LONG bits );
  335. BOOL CFSSetComment( glb glob, struct CFSLock *parent, char *name, char *comment );
  336. BOOL CFSSetDate( glb glob, struct CFSLock *parent, char *name, struct DateStamp *ds );
  337. BOOL CFSSameLock( glb glob, struct CFSLock *l1, struct CFSLock *l2 );
  338.  
  339.  
  340. /* file.c */
  341. struct CFSFH *RawCFSOpen(glb glob, struct CFSLock *lock, char * name, LONG mode );
  342. struct CFSFH *CFSOpen(glb glob,struct CFSLock * parentlock, char * name,LONG mode);
  343. BOOL CFSClose( glb glob, struct CFSFH *fh );
  344. LONG CFSRead( glb glob, struct CFSFH *fh, void *buf, LONG len );
  345. LONG CFSWrite( glb glob, struct CFSFH *fh, void *buf, LONG len );
  346. LONG CFSSeek( glb glob, struct CFSFH *fh, LONG pos, LONG offset );
  347.  
  348. /* pack.c */
  349. LONG xFileType( glb glob, struct FileHandle *xfh );
  350.  
  351. /* xobj.c */
  352. struct XpkFH *XpkOpenOldFile( glb glob, struct FileHandle *xfh );
  353. LONG XObjClose( glb glob, struct CFSFH *fh );
  354. LONG XObjRead( glb glob, struct CFSFH *fh, UBYTE *buf, LONG len );
  355. LONG XObjWrite( glb glob, struct CFSFH *fh, UBYTE *buf, LONG len );
  356. LONG XObjSeek( glb glob, struct CFSFH *fh, LONG pos, LONG offset );
  357. void XObjStealXpkFH(glb glob, struct CFSFH *fh);
  358. BOOL XObjStuffFH(glb glob, struct CFSFH *fh, char *name, struct CFSLock *parent);
  359. void XObjUnStuffFH(glb glob, struct CFSFH *fh);
  360. void XObjFreeFH(glb glob, struct CFSFH *fh);
  361. struct CFSFH *XObjCreateFH(glb glob, struct FileHandle *xfh, LONG mode, char *name,struct CFSLock *parent);
  362. struct CFSLock *XObjMakeLock( glb glob, struct FileLock *xlock, LONG mode );
  363. struct CFSLock *XObjDupLock( glb glob, struct CFSLock *lock );
  364. void XObjAddReferenceToLock(glb glob, struct CFSLock *lock);
  365. struct CFSLock *XObjParentDir( glb glob, struct CFSLock *lock );
  366. BOOL XObjUnLock( glb glob, struct CFSLock *lock );
  367. BOOL XObjSameLock(glb glob, struct CFSLock *l1, struct CFSLock *l2 );
  368. BOOL XObjExamine( glb glob, struct CFSLock *lock, struct FileInfoBlock *fib );
  369. BOOL XObjExNext( glb glob, struct CFSLock *lock, struct FileInfoBlock *fib );
  370. BOOL ModifyFIB( glb glob, struct CFSLock *lock, struct FileInfoBlock *fib );
  371. BOOL XObjModifyFIB( glb glob, struct CFSLock *lock,struct FileInfoBlock *fib, struct FileHandle *xfh );
  372. struct CFSLock *XObjCreateDir( glb glob, struct CFSLock *parentlock, char *name );
  373. BOOL XObjSetProtection(glb glob, struct CFSLock *parent, char *name, LONG mask);
  374. BOOL XObjSetComment(glb glob, struct CFSLock *parent, char *name, char *comment);
  375. BOOL XObjSetFileDate(glb glob, struct CFSLock *parent, char *name, struct DateStamp *ds);
  376. BOOL XObjDeleteFile(glb glob, struct CFSLock *parent, char *name);
  377. BOOL XObjRename(glb glob, struct CFSLock *p1, char *n1, struct CFSLock *p2, char *n2);
  378.  
  379.  
  380. /* xpk.c */
  381. struct XpkLock;
  382. struct XpkFib;
  383.  
  384. struct XpkFH *XpkOpenOldFile( glb glob, struct FileHandle *xfh );
  385. struct XpkFH *XpkOpenOldFileFromCopyOfLock( glb glob, struct XpkLock *lock );
  386. BOOL IsXpkFile( glb glob, struct FileHandle *xfh );
  387. BOOL PackFile2File(glb glob, struct FileHandle *srcxfh, struct FileHandle *dstxfh, void *dummy);
  388. BOOL UnPackFile2File(glb glob, struct FileHandle *srcxfh, struct FileHandle *dstxfh, void *dummy);
  389. BOOL XpkExamine_FH( glb glob, struct FileHandle *xfh, struct XpkFib *fib );
  390. LONG Xpk_Read( glb glob, struct XpkFH *fh, UBYTE *buf, LONG len );
  391. LONG Xpk_Write(glb glob, struct XpkFH *fh, UBYTE *buf, LONG len);
  392. LONG Xpk_Seek( glb glob, struct XpkFH *fh, LONG pos, LONG offset );
  393. BOOL Xpk_Close( glb glob, struct XpkFH *fh );
  394. struct XpkLock *XpkMakeLock( glb glob, struct FileLock *xlock, LONG mode );
  395. struct XpkLock *XpkDupLock( glb glob, struct XpkLock *lock );
  396. struct CFSLock *XpkParentDir( glb glob, struct XpkLock *lock );
  397. BOOL XpkUnLock( glb glob, struct XpkLock *lock );
  398. BOOL XpkSameLock(glb glob, struct XpkLock *l1, struct XpkLock *l2 );
  399. BOOL XpkObjExamine( glb glob, struct XpkLock *lock, struct FileInfoBlock *fib );
  400. BOOL XpkModifyFIB( glb glob, struct XpkLock *lock,struct FileInfoBlock *fib, struct FileHandle *xfh );
  401. BOOL InitXpk( glb glob );
  402. void CleanupXpk( glb glob );
  403.  
  404.  
  405. /* packfunc.c */
  406. BOOL ModifyFIB_type( glb glob, LONG type, struct CFSLock *lock,    struct FileInfoBlock *fib, struct FileHandle *xfh );
  407.  
  408.  
  409. /* options.c */
  410. BOOL set_option(glb glob, char *p);
  411. BOOL InitOptions(glb glob);
  412. void CleanupOptions(glb glob);
  413. BOOL SetOptionPermanent(glb glob, char *opt, char *val);
  414. BOOL SetOptionsFromFile(glb glob, struct FileLock *lock, char *name);
  415.  
  416.  
  417. /* arexx.c */
  418. void checkarexxmsg(glb glob);
  419. ULONG arexxsigmask(glb glob);
  420. BOOL InitArexx(glb glob);
  421. void CleanupArexx(glb glob);
  422.  
  423.  
  424. /* gui.c */
  425. BOOL UpdateXFHNode(glb glob);
  426. ULONG guisigmask(glb glob);
  427.  
  428.  
  429. /* End of CFS.h */
  430.